Skip to content

docs: explain package source vs installed copies - #2599

Open
Aryan Singh K. (aryansk) wants to merge 1 commit into
microsoft:mainfrom
aryansk:docs/2183-source-vs-installed
Open

docs: explain package source vs installed copies#2599
Aryan Singh K. (aryansk) wants to merge 1 commit into
microsoft:mainfrom
aryansk:docs/2183-source-vs-installed

Conversation

@aryansk

Copy link
Copy Markdown

Closes #2183

Summary

  • add a package-authoring guide explaining canonical source files versus materialized consumer copies
  • document the recommended git dependency + ref workflow
  • clarify same-repository authoring and the current lack of a live-link development mode

Validation

  • documentation-only change; patch syntax was checked against current main

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds new documentation clarifying the distinction between an APM package’s canonical source repository and the installed (materialized) consumer copy, with recommended workflows for authors and consumers.

Changes:

  • Documented “source vs installed” package concepts and best practices (don’t edit/commit installed copies).
  • Added a step-by-step recommended author/consumer workflow with an example git: dependency.
  • Clarified guidance for authoring and consuming within the same repository, including testing recommendations.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +52 to +55
APM does not currently provide a live-link/development-install mode that keeps
an installed consumer copy synchronized with edits in the source checkout. If
you need immediate feedback while authoring, test from the source repository or
re-run the install/update workflow after changes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (1)

docs/src/content/docs/producer/source-vs-installed.md:13

  • The doc says apm install stages dependencies under apm_modules/, but when users follow the section below about installing globally, the materialized tree lives under ~/.apm/apm_modules/ (user scope). Consider wording this as "under the install scope's apm_modules/ directory" and explicitly calling out both paths so readers can map what they see on disk.
- **The installed copy is materialized consumer content.** `apm install`
  resolves the declared dependency and stages the pinned package under
  `apm_modules/` before integrating its primitives into the selected targets.

@sergio-sisternes-epam

Copy link
Copy Markdown
Collaborator

APM Review Panel: needs_rework

Solid mental-model doc blocked by an incorrect dependency schema example that would mislead package authors at the point of highest trust.

cc Aryan Singh K. (@aryansk) Daniel Meppiel (@danielmeppiel) Sergio Sisternes (@sergio-sisternes-epam) -- a fresh advisory pass is ready for your review.

Eight of nine panelists agree this page fills a real gap -- the node_modules analogy lands, the copy-not-symlink mental model is correct, and the page addresses a documented drop-off point. No disagreement there.

The doc-writer's blocking finding is decisive: the code example uses a flat-list shorthand (- git: acme/ai-primitives) that does not match APM's actual dependency schema. This was independently verified against manage-dependencies.md. A documentation page whose sole purpose is to teach the source-vs-installed contract cannot ship with a YAML snippet that would fail on apm install. The fix is mechanical (swap to object form with full URL + ref, or use the string shorthand owner/repo#tag), but it must land before merge.

Beyond the blocker, the panel converges on a discoverability gap: the page exists but has no inbound links, no sidebar registration, and no cross-references. Three panelists (devx-ux, doc-writer, growth-hacker) independently flagged this. A page that cannot be found is a page that does not reduce friction. Sidebar wiring and at least one inbound link from quickstart should be in the same PR.

The supply-chain-security expert's call to note that tags are mutable and the lockfile pins the immutable SHA is a high-value one-liner that reinforces APM's secure-by-default positioning without bloating the page.

Dissent. No substantive disagreement between panelists. The only variance is severity: devx-ux and doc-writer both flagged cross-link/sidebar gaps as recommended, while growth-hacker framed the same gap as a conversion miss. All three align on the same fix (wire the page into navigation). Siding with doc-writer's framing -- sidebar registration is a correctness issue for docs, not merely a growth tactic.

Aligned with: Portable by manifest -- the page teaches that apm.yml is the single source of truth and installed copies are derived artifacts, directly reinforcing manifest portability (though the incorrect schema example currently undermines this). Pragmatic as npm -- the node_modules analogy is the right pedagogical frame for JS-crossover users; closing the loop with apm.lock.yaml would complete the npm parallel.

Growth signal. Open a tracked issue for live-link/dev-install mode and link it from this page's "no live-link" disclosure. That converts a limitation disclosure into a contributor funnel. The social beat ("If you've ever edited node_modules and regretted it...") is a good launch-day hook once the page ships correctly.

Panel summary

Persona B R N Takeaway
Python Architect 0 0 1 Documentation-only PR; the conceptual model accurately reflects APM's actual architecture. No architectural concerns.
CLI Logging Expert 0 0 1 No CLI source changes. Guide accurately describes apm install behavior conceptually. No blocking/recommended findings.
DevX UX Expert 0 2 2 Solid mental-model doc. node_modules analogy apt. A few cross-link and discoverability gaps.
Supply Chain Security Expert 0 1 2 Documentation-only change. Example uses pinned version tag (good). Page misses opportunity to warn about mutable refs and lockfile SHA.
OSS Growth Hacker 0 1 2 Solid friction-reducer. node_modules analogy lands well for JS audience. Misses contributor hook on live-link gap.
Auth Expert -- -- -- No auth surface touched; ship.
Doc Writer 1 3 1 New page is well-scoped but has two correctness issues: wrong dependency schema in code example, and page not wired into the sidebar.
Test Coverage Expert -- -- -- Documentation-only PR; no runtime code paths to defend.
Performance Expert -- -- -- No performance surface touched; ship.

B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.

Top 5 follow-ups

  1. [Doc Writer] (blocking-severity) Fix dependency schema in code example to use valid object form or string shorthand. -- Current snippet would fail at apm install -- misleads authors at the highest-trust moment in the doc.
  2. [Doc Writer] Register page in astro.config.mjs sidebar and add frontmatter sidebar.order. -- Without sidebar wiring the page is invisible to browsing readers -- zero discoverability.
  3. [Supply Chain Security Expert] Add one-liner noting tags are mutable; lockfile pins immutable commit SHA. -- Reinforces secure-by-default positioning at near-zero cost; prevents authors from trusting mutable refs in production.
  4. [DevX UX Expert] Add cross-links from quickstart and CLI reference into this page. -- Three panelists independently flagged the page as an island; inbound links are the minimum viable discoverability fix.
  5. [OSS Growth Hacker] Open tracked issue for live-link/dev-install mode; link from the "no live-link" disclosure. -- Converts a limitation disclosure into a contributor funnel -- captures frustrated authors at peak motivation.

Architecture

classDiagram
    direction LR
    class SourceRepository {
        <<Canonical>>
        +apm.yml
        +primitives/
    }
    class ConsumerProject {
        +apm.yml
        +apm.lock.yaml
        +apm_modules/
    }
    class DependencyReference {
        <<ValueObject>>
        +git str
        +ref str
    }
    class ResolvedReference {
        <<ValueObject>>
        +commit_sha str
        +tag str
    }
    class InstalledCopy {
        <<Materialized>>
        +primitives/
    }
    ConsumerProject *-- DependencyReference : declares in apm.yml
    ConsumerProject *-- ResolvedReference : pins in apm.lock.yaml
    ConsumerProject *-- InstalledCopy : stages in apm_modules/
    DependencyReference ..> SourceRepository : points to
    ResolvedReference ..> SourceRepository : resolved from
    InstalledCopy ..> SourceRepository : materialized from
    class InstalledCopy:::touched
    class SourceRepository:::touched
    classDef touched fill:#fff3b0,stroke:#d47600
Loading
flowchart TD
    A[Author edits primitives in source repo] --> B[Consumer declares git: + ref: in apm.yml]
    B --> C[apm install resolves dependency]
    C --> D[NET: Clone/fetch from git remote]
    D --> E[FS: Write resolved SHA to apm.lock.yaml]
    E --> F[FS: Stage package into apm_modules/]
    F --> G[FS: Integrate primitives into targets]
    H[Source package updated] --> I[Update ref: in apm.yml]
    I --> C
Loading

Recommendation

The page concept is correct and fills a real gap, but the dependency schema example is demonstrably wrong and would mislead authors. Fix the YAML snippet (mechanical, under 5 min), wire the page into the sidebar, and this is ready to ship. The remaining recommended items (lockfile SHA note, cross-links, live-link issue) can land in the same PR or as fast follow-ups at author discretion.


Full per-persona findings

Python Architect

  • [nit] Example uses shorthand git: acme/ai-primitives but doesn't clarify host resolution at docs/src/content/docs/producer/source-vs-installed.md:35
    The spec supports both clone URLs and shorthands for the git: field. The example uses shorthand form without mentioning that host resolution depends on authentication configuration.
    Suggested: Consider adding a brief note or link to the authentication docs explaining how acme/ai-primitives resolves to a full clone URL.

CLI Logging Expert

  • [nit] Step 4 vaguely says 'the appropriate update workflow' -- could name apm update
    The doc already names apm install explicitly in step 3. Step 4 hedges with 'appropriate update workflow' instead of naming apm update, which is the actual command.
    Suggested: Replace 'or use the appropriate update workflow' with 'or run apm update' if that command exists and is stable, otherwise leave as-is.

DevX UX Expert

  • [recommended] Missing cross-links to/from quick-start and CLI reference
    A new user hitting confusion about source vs installed will not discover this page unless it's linked from the getting-started funnel (quick-start.md, first-package.md) or from apm install in cli-commands.md.
    Suggested: Add a short 'See also' callout in quick-start.md after the install step, and a reference link in the apm install section of cli-commands.md pointing here.
  • [recommended] The 'no live-link mode' disclosure is buried at the bottom
    Users coming from pip's editable installs or npm link will search for that capability first. Burying it in the last paragraph means they scan the whole page before learning it doesn't exist.
    Suggested: Add a one-line tip/admonition after the bullet list stating the limitation upfront, linking to the detailed paragraph below.
  • [nit] node_modules analogy could name the key behavioral difference (apm.lock.yaml derivation)
  • [nit] Consider a frontmatter sidebar position or category tag for discoverability

Supply Chain Security Expert

  • [recommended] Add a note that tags are mutable and the lockfile pins the immutable commit SHA
    A version tag like v1.4.0 can be force-pushed to point at a different commit. Users should understand that apm.lock.yaml records the resolved commit SHA, which is the actual integrity anchor.
    Suggested: Add: 'While ref: v1.4.0 is recommended over branch names, tags are mutable. APM's lockfile (apm.lock.yaml) pins the resolved commit SHA, ensuring reproducible installs regardless of tag movement. Always commit your lockfile.'
  • [nit] Warn against using branch refs (e.g. ref: main) in production
  • [nit] The 'do not edit installed copies' guidance could mention integrity verification

OSS Growth Hacker

  • [recommended] Missing contributor hook on the live-link gap disclosure
    This is the exact moment a frustrated author is most receptive to contributing. A one-line link to an issue converts frustration into engagement.
    Suggested: Add: 'Want live-link support? Follow or contribute to issue #NNNN for the design discussion.'
  • [nit] Opening paragraph could lead with the pain, not the architecture
    Suggested: Consider a one-line callout like: 'Edited a file under apm_modules/ and lost your changes on the next install? This page explains why -- and the workflow that avoids it.'
  • [nit] No cross-link to quickstart or first-package guide

Auth Expert -- inactive

No auth files touched; the PR adds a documentation page only and does not change token management, credential resolution, or host classification.

Doc Writer

  • [blocking] Code example uses the wrong dependency schema -- flat list under dependencies: and shorthand owner/repo in git: field at docs/src/content/docs/producer/source-vs-installed.md:32
    manage-dependencies.md shows the correct top-level key is dependencies.apm (a mapping, not a flat sequence). The git: object form takes a full URL (https://github.com/acme/ai-primitives) not an owner/repo shorthand. The snippet as written would fail at apm install.
    Suggested: Replace with:
    dependencies:
      apm:
        - git: https://github.com/acme/ai-primitives
          ref: v1.4.0
    Or use string shorthand: - acme/ai-primitives#v1.4.0 (no git: key needed for GitHub-hosted packages).
  • [recommended] Page is not registered in the sidebar (astro.config.mjs) and will not appear in navigation
    Suggested: Add { label: 'Source vs installed', slug: 'producer/source-vs-installed' } to the producer items array.
  • [recommended] Frontmatter missing sidebar.order -- non-deterministic ordering vs other producer pages
    Suggested: Add sidebar: order: N consistent with intended placement.
  • [recommended] No outgoing or incoming cross-links -- page is an island
    Suggested: Link to ../../consumer/manage-dependencies/ for the full dependency reference format; link to ./repo-shapes/ in the same-repo section; add entry to producer/index.md.
  • [nit] description frontmatter could be more concise for SEO

Test Coverage Expert -- inactive

Documentation-only PR -- no runtime code paths to defend.

Performance Expert -- inactive

Documentation-only PR; no performance-sensitive code paths touched.

This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.

@sergio-sisternes-epam Sergio Sisternes (sergio-sisternes-epam) removed the panel-review Trigger the apm-review-panel gh-aw workflow label Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Question : How to avoid duplicated AI primitives when those are present in Git repo and install in dev local computer

3 participants